/*
 * Project Name:yunjiafen
 * File Name:RequestContextMng.java
 * Package Name:com.bestapp.yunjiafen.core.util
 * Date:2018年09月21日下午10:46
 * Copyright (c) 2018, bestapp All Rights Reserved.
 *
 */

package com.gitee.xmhzzz.component.spring.cloud.component.dao.context;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
  * @ClassName
  * @Description
  * @Author wzq
  * @Date 2023/12/15 16:46
  * @Version 1.0
  */
public class PageContextMng {
    private static final Logger log = LoggerFactory.getLogger(PageContextMng.class);
    private static ThreadLocal<PageContext> contextThreadLocal = ThreadLocal.withInitial(PageContext::new);

    public static void clear() {
        contextThreadLocal.remove();
    }

    public static void context(PageContext context) {
        contextThreadLocal.set(context);
    }

    public static PageContext context() {
        return contextThreadLocal.get();
    }
}
